import {ApiProperty} from '@nestjs/swagger'
import {IsAlphanumeric,IsEmail,IsString,IsOptional,MaxLength} from 'class-validator'

export class CreateUserDto {
    @ApiProperty({description:'用户名'})
    @IsAlphanumeric()
    @MaxLength(14)
    username:string;

    @ApiProperty({description:'密码'})
    @IsString()
    password:string;

    @ApiProperty({required:false,description:'邮箱'})
    @IsOptional()
    @IsEmail()
    email?:string;
}
